package com.freight.order.controller;

import com.freight.core.common.utils.ResultUtil;
import com.freight.core.common.vo.Result;
import com.freight.order.dto.*;
import com.freight.order.service.PcOrderEntrustedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(description = "平台端 --- 订单接口")
@RequestMapping("/freight/pcOrderEntrusted")
@Transactional
public class PcOrderEntrustedController  {

    @Autowired
    private PcOrderEntrustedService pcOrderEntrustedService;


    @RequestMapping(value = "/dispatchOrder", method = RequestMethod.POST)
    @ApiOperation(value = "调度派单 ----- 平台指定司机运输")
    public Result<String> dispatchOrder(EntrustDriverDto entrustDriverDto) {
        pcOrderEntrustedService.dispatchOrder(entrustDriverDto);
        return ResultUtil.success("操作成功");
    }

}
